﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="web_uchet.Security.Enums" %>
<% web_uchet.Security.ProgramContext MData = ViewData["Master"] as web_uchet.Security.ProgramContext;%>
<td align="left" id="pager_left">
        <table cellspacing="0" cellpadding="0" border="0" style="float: left; table-layout: auto;" class="ui-pg-table navtable">
        <tbody>
            <tr>
            <% if (MData.Roles.Contains(UserRoleEnum.Администратор) || 
            MData.Roles.Contains(UserRoleEnum.Менеджер))
               {%>
             <td class="ui-pg-button ui-corner-all" title="Добавление нового заказа" style="cursor: pointer;">
                <div class="ui-pg-div" onclick="Create();">
                <span class="ui-icon ui-icon ui-icon-carat-1-e"></span>Новый 
                </div>
            </td>
             <td style="width: 4px;" class="ui-pg-button ui-state-disabled">
                <span class="ui-separator"></span>
            </td>
            <td class="ui-pg-button ui-corner-all" title="Правка данных заказа" style="cursor: pointer;">
                <div class="ui-pg-div" onclick="Edit();">
                <span class="ui-icon ui-icon ui-icon-carat-1-e"></span>Правка 
                </div>
            </td>
             <td style="width: 4px;" class="ui-pg-button ui-state-disabled">
                <span class="ui-separator"></span>
            </td>           
            <%} %>
            <td class="ui-pg-button ui-corner-all" title="Перейти на страницу с деталями заказа" style="cursor: pointer;">
                <div class="ui-pg-div" onclick="Details();">
                <span class="ui-icon ui-icon ui-icon-carat-1-e"></span>Детали 
                </div>
            </td>
            <td style="width: 4px;" class="ui-pg-button ui-state-disabled">
                <span class="ui-separator"></span>
            </td>
            

            <% if (MData.Roles.Contains(UserRoleEnum.Администратор)){ %>
            <td class="ui-pg-button ui-corner-all" title="Удаление заказа" style="cursor: pointer;">
                <div class="ui-pg-div" onclick="Delete();">
                <span class="ui-icon ui-icon ui-icon-carat-1-e"></span>Удалить 
                </div>
            </td>
             <td style="width: 4px;" class="ui-pg-button ui-state-disabled">
                <span class="ui-separator"></span>
            </td>
            <%} %>
             <% if (MData.Roles.Contains(UserRoleEnum.Администратор)
                    || MData.Roles.Contains(UserRoleEnum.Менеджер))
               {%>
            <td class="ui-pg-button ui-corner-all" title="Отменить заказ" style="cursor: pointer;">
                <div class="ui-pg-div" onclick="SetCancelled();">
                <span class="ui-icon ui-icon ui-icon-carat-1-e"></span>Отменен 
                </div>
            </td>
             <td style="width: 4px;" class="ui-pg-button ui-state-disabled">
                <span class="ui-separator"></span>
            </td>
            <%} %>
            <% if (MData.Roles.Contains(UserRoleEnum.Администратор) || MData.Roles.Contains(UserRoleEnum.Менеджер)
                   || MData.Roles.Contains(UserRoleEnum.Исполнитель))
               {%>
            <td class="ui-pg-button ui-corner-all" title="Пометить выполненным" style="cursor: pointer;">
                <div class="ui-pg-div" onclick="SetExecute();">
                <span class="ui-icon ui-icon ui-icon-carat-1-e"></span>Выполнен 
                </div>
            </td>
            <td style="width: 4px;" class="ui-pg-button ui-state-disabled">
                <span class="ui-separator"></span>
            </td>
            <%} %>                
            <% if (MData.Roles.Contains(UserRoleEnum.Администратор) || MData.Roles.Contains(UserRoleEnum.Менеджер)
                   || MData.Roles.Contains(UserRoleEnum.Просмотр))
               {%>
            <td class="ui-pg-button ui-corner-all" title="В Word" 
                style="cursor: pointer; background-color:#F0FFFF;">
                <div class="ui-pg-div" onclick="GetReport();">
                <span class="ui-icon ui-icon ui-icon-carat-1-e"></span>В Word 
                </div>
            </td>
            <td style="width: 4px;" class="ui-pg-button ui-state-disabled">
                <span class="ui-separator"></span>
            </td>
            <%} %>          
            </tr>
        </tbody></table>
    </td> 